/* 明亮主题变量 */
:root {
    --ai-bg-color: #f9fafb;      // 背景色
    --ai-text-color: #333;       // 文字颜色
    --ai-border-color: #e5e7eb; // 边框颜色
    --ai-primary: #3b82f6;      // 主色调（蓝色）
}

.ai-chat-container {
    background-color: var(--ai-bg-color);
    color: var(--ai-text-color);
    border: 1px solid var(--ai-border-color);
}

.ai-logo{
    width: 25px;
    height: 25px;
    pointer-events: none;
    &:active {
        transform: scale(1.1);
    }
}

.btn-ai{
    overflow: hidden;
    width: 3rem;
    height: 8rem;
    flex-direction: column;
    gap: .16667rem;
    border-radius: 2.6667rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #eaedf1;
    background-color: #fff;
    box-shadow: 0 15px 35px -2px rgba(0, 0, 0, .05), 0 5px 15px 0 rgba(0, 0, 0, .05);
    position: fixed;
    bottom: 30px;
    right: 30px;
    cursor: move;
    z-index: 1000;
    pointer-events: auto !important;
    user-select: none;

    &:after {
        overflow: hidden;
        content: "AI\A助\A手";
        margin-left: 2px;
        color: #333;
        font-size: 16px;
        font-style: normal;
        font-weight: 500;
        line-height: 22px;
        letter-spacing: .048px;
        white-space: pre;
    }
}
// 添加深度思考样式
.deep-think {
    color: #999;
    font-size: 12px;
    margin: 8px 0;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;

    &::before {
        content: "💡";
        margin-right: 4px;
    }

    :deep(p) {
        margin: 0;
        display: inline;
    }
}
/* 基础容器 */
.ai-chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f8f9ff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 120, 255, 0.1);
}

/* 消息区域 */
.message-wrapper-layout{
    flex: 1;
    padding: 20px;
    overflow-y: hidden;
    background: #ffffff;
}
.message-wrapper {
    overflow-y: auto;
    height: 36vh;
    margin-bottom: 20px;

     &::-webkit-scrollbar {
         width: 4px;
     }
     &::-webkit-scrollbar-thumb {
         background: rgba(0,0,0,0.2);
         border-radius: 4px;
     }
 }

 /* 欢迎卡片 */
.welcome-card {
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    background-image: linear-gradient(97deg, rgb(242, 249, 254) 0%, rgb(247, 243, 255) 100%);
    display: flex;
    .welcome-icon{
        height: 58px;
        display: flex;
        margin-right: 20px;
    }
    .welcome-content-wrapper{
        gap: 8px;
        flex: auto;
        min-width: 0;
        flex-direction: column;
    }
    .welcome-title{
        line-height: 24px;
        font-size: 18px;
    }
    .welcome-description{
        color: rgba(0, 0, 0, 0.88);
        word-break: break-word;
        line-height: 1.5;
    }
}

/* 消息气泡 */
.message-bubble {
    margin: 12px 0;
    padding: 12px 18px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 0.95em;
    line-height: 1.5;
    animation: slideIn 0.3s ease-out;
}

.message-bubble.user {
    margin-left: auto;
    background: #0066ff;
    color: white;
    border-radius: 12px 12px 4px 12px;
}
/* 添加打字机效果 */
.message-bubble.ai {
    background: #f0f5ff;
    color: #333;
    border-radius: 12px 12px 12px 4px;
    border: 1px solid #e6eaff;
}
.message-bubble.ai .content {
    /*
    white-space: pre-wrap;
     */
    overflow: hidden;
    animation: typing 0.3s steps(40, end);
}
.ai-icon {
    color: #0066ff;
    margin-right: 8px;
    font-weight: bold;
}

/* 输入区域 */
.input-layout{
    border-top: 1px solid #e6eaff;
    display: flex;
    flex-direction: column;
    .input-tip{
        margin: 10px;
        display: flex;
        gap: 12px;

        .input-tip_item{
            display: flex;
            gap: 8px;
            height: auto;
            padding: 6px;
            padding-inline: 16px;
            align-items: center;
            justify-content: center;
            background: rgba(0,0,0,.04);
            border-radius: 8px;
            cursor: pointer;

            .item-prompts_icon{
                width: 16px;
                height: 16px;
                display: flex;
            }
            .icon-hot{
                color: rgb(255, 77, 79);
            }
            .icon-guide{
                color: rgb(24, 144, 255);
            }
            .item-prompts_content{
                flex: auto;
                min-width: 0;
                display: flex;
                gap: 4px;
                flex-direction: column;
                align-items: flex-start;

                .prompts-desc{
                    color:#666;
                    font-size: 12px;
                }
                .prompts-guide{
                    color:rgb(24, 144, 255);
                    font-size: 12px;
                }
            }

        }
    }
    .input-area {
        padding: 10px 20px;
        background: #fff;
    }
}
/* 追加提问 */
.append-tip{
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    width: 100%;

    .append-tip_title{
        color:rgba(0, 0, 0, 0.45);
        font-size: 12px;
        text-align: center;
    }
    .append-tip_group{
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
    }
    .prompts-tip{
        background: rgba(255, 255, 255, 0.45);
        border: 1px solid #f0f0f0;
        padding: 8px;
        font-size: 12px;
        border-radius: 10px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        transition: background 0.3s;

        .tip-next{
            color: #333;
            margin-top: 2px;
        }
    }
    .prompts-tip:hover {
        background: #e9ecef;
    }
    .loading-suggestions {
        padding: 12px;
        color: #666;
        text-align: center;
    }
}

.sci-input :deep(.ant-input) {
    background: #fff;
    border-radius: 24px;
    padding: 10px;
    color: #333;
    transition: all 0.3s;
}

/* 发送按钮 */
.send-btn,.stop-btn {
    background: #0066ff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    color: #fff;
    font-size: 18px;
}
.stop-btn{
    background:#666 ;
}


@keyframes typing {
    from { max-height: 0; opacity: 0; }
    to { max-height: 1000px; opacity: 1; }
}
/* 加载动画 */
.loading-wave {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 15px;
}
.wave-dot {
    width: 8px;
    height: 8px;
    background: #0066ff;
    border-radius: 50%;
    animation: wave 1.2s infinite ease-in-out;
}
.wave-dot:nth-child(2) { animation-delay: 0.2s; }
.wave-dot:nth-child(3) { animation-delay: 0.4s; }
/* Markdown 内容样式 */
.custom-markdown {
    line-height: 1.8;
    color: #1f2329;
    font-family: system-ui, -apple-system, sans-serif;
    // 新增思考内容样式
    :deep(think) {
        color: #999;
        font-size: 13px;
        display: block;
        padding: 8px 12px;
        margin: 8px 0;
        background: #f5f5f5;
        border-radius: 6px;
        border-left: 3px solid #ddd;

        // 思考内容中的代码样式
        code {
            background: rgba(0,0,0,0.05);
            color: #666;
        }
    }

    // 正常回答内容样式
    :deep(p:not(think)) {
        color: var(--ai-text-color); // 使用原有文字颜色
        font-size: 14px;
        line-height: 1.8;
        margin: 12px 0;
    }

    // 保持其他正常内容样式
    :deep(pre, code:not(think code)) {
        background: linear-gradient(145deg, #f6f8fa, #ffffff);
        color: #333; // 正常代码颜色
    }

    h1, h2, h3 {
        margin: 1.2em 0 0.6em;
        font-weight: 600;
        position: relative;

        &::after {
            content: "";
            display: block;
            width: 40px;
            height: 2px;
            background: var(--ai-primary);
            margin-top: 6px;
        }
    }

    p {
        margin: 0.8em 0;
        word-wrap: break-word;
    }

    pre {
        background: linear-gradient(145deg, #f6f8fa, #ffffff);
        border-radius: 12px;
        padding: 16px;
        margin: 1em 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        position: relative;
        overflow-x: auto;

        &::before {
            content: attr(data-lang);
            position: absolute;
            right: 16px;
            top: 8px;
            font-size: 0.8em;
            color: #666;
        }
    }

    code:not(pre code) {
        background: rgba(175, 184, 193, 0.15);
        padding: 0.2em 0.4em;
        border-radius: 4px;
        font-size: 0.95em;
    }

    blockquote {
        background: #f8fbff;
        border-left: 4px solid var(--ai-primary);
        margin: 1em 0;
        padding: 12px 16px;
        border-radius: 0 8px 8px 0;
        color: #4a5468;

        p {
            margin: 0;
        }
    }

    ul, ol {
        padding-left: 1.8em;

        li {
            margin: 0.4em 0;
            &::marker {
                color: var(--ai-primary);
            }
        }
    }

    table {
        width: 100%;
        border-collapse: collapse;
        margin: 1.5em 0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

        th {
            background: var(--ai-primary);
            color: white;
            padding: 12px;
            text-align: left;
        }

        td {
            padding: 12px;
            border-bottom: 1px solid #eee;
        }

        tr:nth-child(even) {
            background: #f8f9fa;
        }
    }

    a {
        color: var(--ai-primary);
        text-decoration: none;
        transition: all 0.2s;

        &:hover {
            color: #1d4ed8;
            text-decoration: underline;
        }
    }

    img {
        max-width: 100%;
        border-radius: 8px;
        margin: 1em 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
}
/* 覆盖 antd 默认样式 */
.drag-modal .ant-modal-content {
    position: fixed !important;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

/* 拖拽时提升层级 */
.drag-modal .ant-modal-content {
    transition: box-shadow 0.3s;
}

.drag-modal.dragging .ant-modal-content {
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    cursor: move;
}
.ant-modal {
    transition: width 0.3s, height 0.3s;
}
/* 拖拽标题样式 */
.drag-header {
    width: 90%;
    cursor: move;
    user-select: none;
    position: relative;

}
::v-deep .ant-modal-title{
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
::v-deep .ant-modal-close{
    top: 21px;
}
/* 防止内容区域干扰拖拽 */
.drag-header * {
    pointer-events: none;
}
// 添加标题栏样式
.header-actions {
    flex:1;
    display: flex;
    justify-content: flex-end;
    margin-right: 20px;
    color: #999;
}

// 调整全屏模式下的modal样式
.full-modal {
    .ant-modal {
        max-width: 100%;
        top: 0;
        padding-bottom: 0;
        margin: 0;
    }
    .ant-modal-content {
        display: flex;
        flex-direction: column;
        height: calc(100vh);
    }
    .ant-modal-body {
        flex: 1;
    }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes wave {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}
